package com.health.medicine.model.dto.medicine;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.health.medicine.model.enums.MedicineTypeEnums;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Builder;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author zhexueqi
 * @ClassName AddDrugInfoRequest
 * @since 2024/8/29    0:56
 */
@Data
@Builder
public class AddDrugInfoRequest {


    //用户私钥
    @NotBlank(message = "私钥不能为空")
    @Schema(description = "privateKey")
    private String privateKey;

    // 药品名称，用于唯一标识药品 example
    @NotBlank(message = "药品名称不能为空")
    @Schema(description = "药品名称")
    private String drugName;

    // 药品类型，描述药品的类别如中药、西药等
    @NotNull(message = "药品类型不能为空")
    @Schema(description = "药品类型,取值范围：1-中药；2-西药；3-化学药品；4-生物制品")
    private Integer drugType;

    // 药品剂型，描述药品的形式如片剂、胶囊等
    @NotBlank(message = "药品剂型不能为空")
    @Schema(description = "药品剂型")
    private String drugForm;

    // 药品规格，详细描述药品的规格信息如0.1g*12片/板
    @NotBlank(message = "药品规格不能为空")
    @Schema(description = "药品规格")
    private String drugSpec;

    // 药品单位，药品的计量单位如瓶、盒、支等
    @NotBlank(message = "药品单位不能为空")
    @Schema(description = "药品单位")
    private String drugUnit;

    @NotNull(message = "生产日期不能为空")
    @Schema(description = "生产日期 yyyy-MM-dd HH:mm:ss")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime productionDate;

    @NotNull(message = "过期日期不能为空")
    @Schema(description = "过期日期 yyyy-MM-dd HH:mm:ss")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime expirationDate;

    @NotBlank(message = "收获用户地址不能为空")
    @Schema(description = "收获用户地址")
    private String receiverAddress;

    @NotNull(message = "运输数量不能为空")
    @Schema(description = "运输数量")
    @Min(value = 1, message = "运输数量不能为空")
    private Integer transportQuantity;

    @NotNull(message = "运输单位不能为空")
    @Schema(description = "运输单位")
    @Min(value = 1, message = "运输单位不能为空")
    private Long transporterId;

}
